SftTree/DLL 6.5

Creating a Dialog Resource with Visual C++

Softel vdm, Inc.

This section describes how to add a tree control to a dialog using Visual C++ 6.0 and Visual Studio .NET.

Adding a Tree Control to a Dialog

To add a SftTree/DLL control to a dialog, use the "Custom Control" toolbar button.  Click on the button and then the dialog being designed to add a control.

Visual C++ 6.0 and eMbedded Visual C++ 4.0

Visual Studio .NET through Visual Studio 2010

Once a custom control has been added to a dialog, you can edit the control properties by using the View, Properties... menu command.

Visual C++ 6.0 and eMbedded Visual C++ 4.0

Visual Studio .NET through Visual Studio 2010

To define a SftTree/DLL control, enter the class SftTreeControl65 or SftTreeSplit65 in the edit field labeled Class.  A window caption is not necessary, so the edit field marked Caption can be left blank.

 

 

Window Class Name

Tree Control

SftTreeControl65

Split Tree Control

SftTreeSplit65

SftTree/DLL Control Styles

To enter a SftTree/DLL window style in the User Control Properties dialog, use the following list to add the desired style values and enter the resulting hexadecimal value in the field marked Style.  For detailed information, see "Window Styles".

The SftTree/DLL Wizard displays the style value as part of the generated source code so it can be copied.

 

Style

Value

Description

SFTTREESTYLE_DISABLENOSCROLL

0x00000001

Prevents the scroll bars from being hidden when scrolling is not possible.  The scroll bars are disabled when scrolling is not possible.

SFTTREESTYLE_DRAGDROP

0x00000010

Enables drag & drop processing for the tree control. WM_COMMAND messages are then sent to the tree control's parent window for drag & drop processing.

SFTTREESTYLE_LEFTBUTTONONLY

0x00000020

When this style is selected, the tree control will ignore the middle and right mouse buttons.  No notifications will be sent to the parent window when the middle or right mouse buttons are clicked.  WM_CONTEXTMENU messages are generated instead.

SFTTREESTYLE_MULTIPLESEL

0x00000008

Enables multiple tree items to be selected at the same time.  The mouse, the Shift and Control keys can be used to select multiple items.

SFTTREESTYLE_NOTIFY

0x00000004

The SftTree/DLL control will send WM_COMMAND messages to the parent window for special event notification.

SFTTREESTYLE_SCROLL

0x00000040

When this style is selected, the window styles WS_HSCROLL and WS_VSCROLL given when the tree control is created determine whether scroll bars are present.  If this style is not selected, scroll bars are automatically added to the tree control when needed.  E.g., to prevent a vertical scroll bar from being added to the tree control, define the SFTTREESTYLE_SCROLL style and do not add the WS_VSCROLL style.

SFTTREESTYLE_VARIABLE

0x00000080

Defines a variable height tree control, where the height of each item varies based on the fonts, pictures, lines of text, word wrapping and other attributes used.

SFTTREESTYLE_WANTKEYBOARDINPUT

0x00000002

The SftTree/DLL control will send WM_VKEYTOITEM messages to the parent window for keyboard input processing.

WS_BORDER

0x00800000

Draws a border around the control.  The border is a dark line.

WS_HSCROLL

0x00100000

Adds a horizontal scroll bar to the tree control.

WS_VSCROLL

0x00200000

Adds a vertical scroll bar to the tree control.

Test Mode

In the dialog test mode offered by Visual C++, the SftTree/DLL control will not be displayed.  Instead, a gray box will show the location of the control.  When using the Tab key to test the tab stops, the simulated SftTree/DLL control will not receive the input focus and appear not to have a tab stop defined.

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com